class Solution:
    def maxVowels(self, s: str, k: int) -> int:
        ans = -inf
        total = 0
        for i, x in enumerate(s):
            # 1 进入如果是元音，计数加一
            if x in "aeiou":
                total += 1
                if total == k:
                    return k
            if i < k - 1: # 窗口小于k
                continue
            # 2 更新答案
            ans = max(total, ans)

            # 3 离开窗口，是元音计数减一
            if s[i - k + 1] in "aeiou":
                total -= 1
        return ans